/**
 * @title: DemoUrlBlockHandler
 * @projectName mscloud
 * @Description TODO
 * @Author
 * @Date 2022/2/16 14:39
 */
package com.atguigu.springcloud.cloudsentinelgatewaydevelop.sentinel;


import com.alibaba.csp.sentinel.adapter.spring.webflux.callback.BlockRequestHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;



public class DemoUrlBlockHandler implements BlockRequestHandler {


    @Override
    public Mono<ServerResponse> handleRequest(ServerWebExchange serverWebExchange, Throwable throwable) {
        return ServerResponse.badRequest().bodyValue("block url");
    }
}
